<?php
/**
 * Created by PhpStorm.
 * User: Powerless
 * Date: 2017-6-30
 * Time: 13:42
 */
namespace app\admin\model;

use think\Model;

class ThemeModel extends Model
{

    public function updateTheme($theme)
    {
        $manifest = "themes/$theme/manifest.json";
        if (file_exists_case($manifest)) {
            $manifest  = file_get_contents($manifest);
            $themeData = json_decode($manifest, true);
            $this->save($themeData, ['theme' => $theme]);
            return true;
        } else {
            return false;
        }
    }



}